package com.pinoc.demo.service.es;

import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.common.xcontent.XContentBuilder;

import java.io.IOException;

/**
 * es 相关操作
 * 
 * @author yinpeng
 */
public interface EsOperateService {

	/**
	 * 
	 * @param indexName
	 *            索引
	 * @param documentId
	 *            文档id
	 * @param content
	 *            更新内容
	 */
	void upsert(String indexName, String documentId, XContentBuilder content);

	boolean existIndex(String indexName) throws IOException;

	GetResponse getById(String indexName, String id) throws IOException;
}
